<% layout('/layout/default.html', {title: '用户管理', libs: ['dataGrid','icheck']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa icon-user"></i> 机构信息调整
			</div>
		</div>
		
		<div class="box-tools pull-right">
				<a href="#" class="btn btn-default"  id="btnRefreshTree" title="刷新"><i class="fa fa-refresh"></i> 刷新</a>
				<% if(hasPermi('sys:user:edit')){ %>
					<a href="/sys/user/insertOrgan" class="btn btn-default btnTool" title="新增机构信息"><i class="fa fa-plus"></i> 新增</a>
				<% } %>
			</div>
		</div>
		
		
		
		<div class="box-body">
			<#form:form id="searchForm"  action="${ctx}/sys/user/organData" method="post" class="form-inline "
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
			</#form:form>
			
			<script type="text/javascript">
				function resetForm(){
					$(':input', '#searchForm')
					        .val('')
					        .removeAttr('checked')
					         .removeAttr('selected');
				}
			</script>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<script id="importTpl" type="text"></script>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'机构名称', name:'organName', index:'organName', width:200, align:"center"},
		{header:'机构树(Json)', name:'organJson', index:'organJson', width:200, align:"center"},
        {header:'区域', name:'code', index:'code', width:200, align:"center"},
		
		
		
		{header:'操作', name:'actions', width:200, sortable:false,align:"center", title:false, formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('sys:user:edit')){ %> 
				actions.push('<a href="/sys/user/formorgan?id='+row.id+' &op=edit" class="btnList" title="编辑机构信息"><i class="fa fa-pencil"></i></a>');
				
				actions.push('<a href="${ctx}/sys/user/deleteOrgan?id='+row.id+'" class="btnList" title="删除机构信息" data-confirm="确认要删除该用户吗?"><i class="fa fa-trash-o"></i></a>');
			<% } %>
			return actions.join('');
		}}
	],
	
	
	// 加载成功后执行事件
	ajaxSuccess: function(data){
	}
});
</script>